UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8bcuUlrnqIjR9+bZ3ZlxQ5ZtFo1lyrl5p8WlBqycFSE=' 
WHERE 
  key_id = '5b5d1ea6d222da9c51eaff5bcf392e6f4909df026c49dff337e05e71db84a516' 
  AND (
    token = '8bcuUlrnqIjR9+bZ3ZlxQ5ZtFo1lyrl5p8WlBqycFSE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035