UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mtk7rB5WBT1oYeCig6/7M5WEP9oe9o70ehlw15S3wYM=' 
WHERE 
  key_id = '0d330a9a7bb49bcb8f5e562b63e1bc0e1db147d26347bf75ac94728a60f6136a' 
  AND (
    token = 'Mtk7rB5WBT1oYeCig6/7M5WEP9oe9o70ehlw15S3wYM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031