UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bo7xn/fBpM1YgUuMvQ5yc4Tr4N9yjQjYA7KI/Xbhhm8=' 
WHERE 
  key_id = '225fcf861baefa90582402f940a08123ffccbb9d73f5a6abdf8195230d9b8730' 
  AND (
    token = 'Bo7xn/fBpM1YgUuMvQ5yc4Tr4N9yjQjYA7KI/Xbhhm8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045