UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'twzH0BtNNH2ehrkQCWXmYb1QMDrWbBtFeKj0eCaZ1EA=' 
WHERE 
  key_id = '04041cdb5be5a8275c1a2180ae693d15208b1ff5f91317fdb1f6ca6cbacc7c3c' 
  AND (
    token = 'twzH0BtNNH2ehrkQCWXmYb1QMDrWbBtFeKj0eCaZ1EA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022