UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rW0T9jwowWD3D36Hh2yIAmruY4KpWv1d8tqrOrYaaNg=' 
WHERE 
  key_id = '72d06a884a3cee22daade9fcafdb1d5d30d834f2c2c5d5aacbab222a576b8891' 
  AND (
    token = 'rW0T9jwowWD3D36Hh2yIAmruY4KpWv1d8tqrOrYaaNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030