UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fgZwp0pjir3eCz0LSQ6ujKOEw3WqgX9Ppj6fycmUuJI=' 
WHERE 
  key_id = '83958599a30c824900ea15ea227eb751deb505df146b192b0b56c3002abac93c' 
  AND (
    token = 'fgZwp0pjir3eCz0LSQ6ujKOEw3WqgX9Ppj6fycmUuJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022