UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IlvqYkJEZ76UrCpuuZy/RvsUkUytHCGnTN1o3JvczAg=' 
WHERE 
  key_id = '5b3e7bc1fce16d61ee0e5d314b94c247fbd80fb00a9684d801e0d6723737d644' 
  AND (
    token = 'IlvqYkJEZ76UrCpuuZy/RvsUkUytHCGnTN1o3JvczAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027