UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aIkZVBBvAxKvS3sQyh/nw4WGVzX5o2KN1BavIXaXw8I=' 
WHERE 
  key_id = '59bca97dac29137c7990d75a2f62739cbcd8db09041bdc1d5a4b43a3b25aa7ff' 
  AND (
    token = 'aIkZVBBvAxKvS3sQyh/nw4WGVzX5o2KN1BavIXaXw8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017