UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'utN9vIhlwQBkYGY7HyB1JVuagiVMVOlEsxSP5r5Kw/c=' 
WHERE 
  key_id = '32d8305462e0e66e01b0a3296eaa2095864fcffbe01351fd69d0aece783836b0' 
  AND (
    token = 'utN9vIhlwQBkYGY7HyB1JVuagiVMVOlEsxSP5r5Kw/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031