UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nMPWGhqKgpBM68nxxc2ACmhMwNGWhEoAWr8y67FqXLw=' 
WHERE 
  key_id = 'ab06a0a622e9370ecfcc72b82dd59ebbc4ee03a3d305a5a799f9efa87377a39c' 
  AND (
    token = 'nMPWGhqKgpBM68nxxc2ACmhMwNGWhEoAWr8y67FqXLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035