UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vqLa9RwT4XXiPlVu3pYM/XJ8jIGlBwZg1+y4CX0nSKs=' 
WHERE 
  key_id = '5a1c13bf04c1d24242ab3ad9506301409b068b61d14162a769c6eaa97eeb7eea' 
  AND (
    token = 'vqLa9RwT4XXiPlVu3pYM/XJ8jIGlBwZg1+y4CX0nSKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033