UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/3gKZqlCi40ZYwk6VDkBtRENywxWHkDlCAmjF/IhxKQ=' 
WHERE 
  key_id = 'f738ab4d5bedf20ee0cfb52188c9e462807313ed2b7e1b5301be29e6c6b2b4b8' 
  AND (
    token = '/3gKZqlCi40ZYwk6VDkBtRENywxWHkDlCAmjF/IhxKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053