UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rrs6XCYXUmDFuGyeOKji/mPTNgnkq8FqrSfMGkgkMX4=' 
WHERE 
  key_id = '5d9530d77defb12bcba22e1bb782bd93b5f932cf10f011293f6b4b3c5f7a9581' 
  AND (
    token = 'Rrs6XCYXUmDFuGyeOKji/mPTNgnkq8FqrSfMGkgkMX4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041