UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zEfZuGc7ykp5KZhNFzZcs3xatSSzo/BFoVcdfrBN09o=' 
WHERE 
  key_id = 'eda3ce1a0506f5dedcee8df44a611d5d02e57cfe7f86e6bc81f52fc0a4c147f2' 
  AND (
    token = 'zEfZuGc7ykp5KZhNFzZcs3xatSSzo/BFoVcdfrBN09o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021