UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'txNH9ygV2owbINTyNml4FloCzNv/3gJf+haCveAKl6A=' 
WHERE 
  key_id = 'fee3254501eb04bcc6daa2c8acabe1fca14bb332cae4b4e597f025add12d9f5a' 
  AND (
    token = 'txNH9ygV2owbINTyNml4FloCzNv/3gJf+haCveAKl6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055