UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I1UEnGsJR9zrM1wX4v44VLbukweLMDg1LeYy9Yr3C6g=' 
WHERE 
  key_id = 'f732f2f5be89a30d9f90ef93c8c1d04f81ccffc0edf5f5aec502b752425aeed8' 
  AND (
    token = 'I1UEnGsJR9zrM1wX4v44VLbukweLMDg1LeYy9Yr3C6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050