UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QZWG3EabvcPoFzu4G20tS82exd06fl0Q1eg+utSoU5I=' 
WHERE 
  key_id = '06a538b0aea4f468fa4b1bbca64b731e6c0a3a7797eef3fca5f294f464c5c71e' 
  AND (
    token = 'QZWG3EabvcPoFzu4G20tS82exd06fl0Q1eg+utSoU5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042