UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IIZCV+LSrykqX/hxuU7KN3lhxgex86ZHT3FUyoJP2Hg=' 
WHERE 
  key_id = '4b57331cde3029fcb7afc4321ff3ed22d70ed568cf25c265af9e4afa8fa704d7' 
  AND (
    token = 'IIZCV+LSrykqX/hxuU7KN3lhxgex86ZHT3FUyoJP2Hg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031