UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd0Q9WNXnAub1Az6OYey2YAfMhO+GpQibwUv9EWmuRkQ=' 
WHERE 
  key_id = 'efeae84ffb044f85ced77e567a09dfc5955428d1df125d01e8be4597072dcc94' 
  AND (
    token = 'd0Q9WNXnAub1Az6OYey2YAfMhO+GpQibwUv9EWmuRkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029