UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SOcbuQvEbqqzpLVg5G+/XI4oGDuMWrj6koaaVhR6FK8=' 
WHERE 
  key_id = '98161e29673b21f1ec3deee12a3a98004f2ec9791f520101a977b4355943b593' 
  AND (
    token = 'SOcbuQvEbqqzpLVg5G+/XI4oGDuMWrj6koaaVhR6FK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055