UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DatXeuF/UBfdsjrA8vnbZMjvXEsLRZsvg4/mb9Eimng=' 
WHERE 
  key_id = 'dbc7d390cca93140a0af8b4c227884f09c810c9ad9b202dbbe31ebe5f0e78105' 
  AND (
    token = 'DatXeuF/UBfdsjrA8vnbZMjvXEsLRZsvg4/mb9Eimng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024