UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/rpjFqZGS4YRZUBfhWom2rRYwUk3DMVGTDd9nIYRlX4=' 
WHERE 
  key_id = '4c67e7d1e69179d83750e3734fb7e787e26b88dc78efc470a7b9f536cdede8e1' 
  AND (
    token = '/rpjFqZGS4YRZUBfhWom2rRYwUk3DMVGTDd9nIYRlX4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031