UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rb+EoUW0WxW76Qzrkx1h4pwqTL9tte8uNmLdASR9fOo=' 
WHERE 
  key_id = '5f290bc1f29fe06f5bf7c21f4ebd6c757c389b09a3fbb1e6d60b3a765f6b1c36' 
  AND (
    token = 'rb+EoUW0WxW76Qzrkx1h4pwqTL9tte8uNmLdASR9fOo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035