UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UsFATUnEqSqhSTimpW4isHTq8vYCV1JPYuXMgDI+cdY=' 
WHERE 
  key_id = 'e0fbdd8376405ce1a6fb915425fccb66b4ddbc5d81ba0f8a29bb75d2c09b3ab7' 
  AND (
    token = 'UsFATUnEqSqhSTimpW4isHTq8vYCV1JPYuXMgDI+cdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027