UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o/LEi2psutqsjtqPCU8AXqam879duXqevWJ8UQfekUk=' 
WHERE 
  key_id = '00bc2d35ae7db862977b7385d19a50da353ee530ab35257b7d91319b76bc700a' 
  AND (
    token = 'o/LEi2psutqsjtqPCU8AXqam879duXqevWJ8UQfekUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027