UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XnhCkcJuqS5O37BhE7SxzivDP2debba/eHRTuTj2tPs=' 
WHERE 
  key_id = '44497529631927ca5fa33861ff98b36b4ac08dc260ab17f3d8123cdb30ac4cbd' 
  AND (
    token = 'XnhCkcJuqS5O37BhE7SxzivDP2debba/eHRTuTj2tPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018