UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mWiu1XqXxtQYE1LrndVdtYq2v/b9QLWc/w+mNvAvJEY=' 
WHERE 
  key_id = '19945d1af81c988fa976b09c8df594e901d333f5f1828239d0e94760f03dcb84' 
  AND (
    token = 'mWiu1XqXxtQYE1LrndVdtYq2v/b9QLWc/w+mNvAvJEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019