UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IxED+g1FslB8vGiNeDovGYszr5459ZiH/RtgM6vcOQk=' 
WHERE 
  key_id = '389efcaf59bd2e66b15a7ac334967010280c60bd7534cdd78d96da8c35eaaecd' 
  AND (
    token = 'IxED+g1FslB8vGiNeDovGYszr5459ZiH/RtgM6vcOQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052