UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zsj8YNpXR+x500LDjhRQnq6YeoTmfU8l7664FLyUs7Q=' 
WHERE 
  key_id = '8db7c2cd359f2d0414db811ec1b899407f03fcb5ff21eb50b06cb2612d76e153' 
  AND (
    token = 'zsj8YNpXR+x500LDjhRQnq6YeoTmfU8l7664FLyUs7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043