UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rhkdGMd3mb1gEcLzw+sUFparluOmIkkKt+nFDBjy80s=' 
WHERE 
  key_id = '035e2c8c44ee7e648096ddf239e1282ed29e64ad42f24e811bae26bea569eaca' 
  AND (
    token = 'rhkdGMd3mb1gEcLzw+sUFparluOmIkkKt+nFDBjy80s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036