UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r7ND/ioUQezqf7+c7woZF9zX8v7uH9uTwz/nacPZcJg=' 
WHERE 
  key_id = '009de0e9471c98fe7282654b9f2a97cc8ae93a3dcb368868d367b630f2b8b4bc' 
  AND (
    token = 'r7ND/ioUQezqf7+c7woZF9zX8v7uH9uTwz/nacPZcJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040